<?php include_once '../../../include/inc_session.php';	

	if(isset($_GET['Identifiant_personne']) && !empty($_GET['Identifiant_personne']))
	{ // Vérifier si Identifiant_personne est passé en paramètre
		$idPersonne = $_GET['Identifiant_personne'];
	}
	$idRole = $_GET['idrole'];
	$idContrat = $_GET['idcontrat'];
	$oRefExt = new dataObject_refExterne();
	
	$aList = $oRefExt->refExterne_getListRefextIntervenant($idPersonne);
	
	if(isset($_GET['msg']) && $_GET['msg']=='supp')
		$oForm->ajouterErreur(communication_deleted);
		
	if(isset($_GET['msg']) && $_GET['msg']=='pbm')
		$oForm->ajouterErreur(chgmt_couv_mod_comm_pbm);
	
	$nommodule2="Liste des références";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=8" />
			<title>Références externes</title>
			<link rel="stylesheet" type="text/css" href="../../../css/main.css" />
            <link rel="stylesheet" type="text/css" href="list.css" />
			<!--[if IE 7]>
            	<link rel="stylesheet" type="text/css" href="../../css/ie7.css" />
            	<link rel="stylesheet" type="text/css" href="form_ie7.css" />
            <![endif]-->
            
			<script language="Javascript">
            <!--
                function modifier(choix)
                {
                    var modifAct = document.getElementById("modifAct");
					
			        modifAct.href = 'mod_refexterne.php?Identifiant_personne=<?php echo $_GET['Identifiant_personne']; ?>&idcontrat=<?php echo $idContrat; ?>&idrole=<?php echo $idRole; ?>&Identifiant_refext=' + choix ;
			    
		                }
            //-->
            </script>
	</head>

<body>
<div id="sf_menu1">
	<h3><?php echo $oBloc->_MENU_NOM ?></h3>
	<div id="information_erreur" class="false">
        <ul id="message">
        	<li><?php $aMsg =$oForm->getValidMessage(); echo (!empty($aMsg))? $aMsg[0]['message'] : ''; ?></li>
        </ul>
    </div>

</div>


<div class="corps1">
<div class="cleared"></div>
<div id="br"></div>
<!--/***************************************/-->
	<div class="imgleft"></div>
	<div class="imgmiddle">
		<div class="btn">
        	<span class="btnleft"></span>
            <span class="btnmiddle">
            	<h5><?php echo $oFonction->_MENU_AFFICHE; ?></h5>
            </span><span class="btnright"></span>
        </div>
		<div class="btn1">
        	<span class="btnleft"></span>
            <span class="btnmiddle">
            	<h5><?php echo $nommodule2; ?></h5>
            </span><span class="btnright"></span>
        </div>
		<div class="cleared"></div>
<table class="tab_liste ns0">
  <tr id="niv1">
  	<td class="td1">&nbsp;</td>
    <td class="td2">TYPE</td>
	<td class="td3">VALEUR</td>
  </tr>
</table>
    	<div class="content_table bright">
    	<table class="tab_list">
  <?php 

  foreach($aList as $i => $aRow) 
  { 
  	$sLibType = dataObject_elementdico::elementdico_getNomFromCode($aRow['Type_refext'], dataObject_dictionnaire::_TYPE_REF_EXTERNE);
	if (count($aList) > 0) 
	{ // Show if recordset not empty
  ?>

    <tr <?php if($i%2==0) echo 'class="colorligne"'; ?>>
      <td class="td1">
      	<input onClick="modifier(this.value);" type="radio" name="choix" id="choix" value="<?php echo $aRow['Identifiant_refext']; ?>" />
      </td>
      <td class="td2"><?php echo $sLibType; ?></td>
      <td class="td3"><?php echo $aRow['Valeur_refext']; ?></td>
    </tr>
    <?php 
	}
	
  } 
  ?>
</table>
		</div>
						<div id="buttonright"><span class="btleft"></span><span class="btmiddle"><a href="insert_refexterne.php?Identifiant_personne=<?php echo $_GET['Identifiant_personne']?>&idcontrat=<?php echo $idContrat; ?>&idrole=<?php echo $idRole; ?>">Créer</a></span><span class="btright"></span></div>
						<div id="buttonright"><span class="btleft"></span><span class="btmiddle"><a id="modifAct" href="#">Modifier</a></span><span class="btright"></span></div>

	
	</div>
	<div class="imgright"></div>
	<div class="cleared"></div>
	<!--/***************************************/-->
<?php
if(isset($_SESSION['visu']))
		$sUrlRetour = "../../changecouverture/intervenant_edit.php?Identifiant_personne=".$_GET['Identifiant_personne']."&idcontrat=".$idContrat."&idrole=".$idRole;
	else $sUrlRetour = "../edit_personne.php?Identifiant_personne=".$_GET['Identifiant_personne']."&idcontrat=".$idContrat."&idrole=".$idRole;
?>
<div class="bt1">
	<a href="<?php echo $sUrlRetour;?>">
    	<span class="btleft"></span>
        <span class="btmiddle">Retour</span>
        <span class="btright"></span>
    </a>
</div>

</body>
</html>
<?php
include_once PATH_INCLUDE.'inc_pied_page.php';

?>